package model.impl;

import sharedGameLogic.players.BattleStatus;

/**
 * Producer according to the 'Builder' pattern.
 * 
 * @author Tobias
 */
class ActionProducer {
	
	//The ActionBuilder currently in use, according to builder pattern
	ActionBuilder actionBuilder;
	
	/**
	 * Empty constructor for the ActionProducer.
	 */
	public ActionProducer(){
	}
	
	/**
	 * Constructor for ActionProducer that also sets the ActionBuilder.
	 * @param ab - The ActionBulider to use
	 */
	public ActionProducer(ActionBuilder ab){
		setActionBuilder(ab);
	}
	
	/**
	 * Mutator for the ActionBuilder.
	 * @param ab - The new ActionBuilder to use.
	 */
	public void setActionBuilder(ActionBuilder ab){
		actionBuilder = ab;
	}
	
	/**
	 * Returns the action product created by the builder
	 * @return - The BattleAction
	 */
	public BattleAction getBattleAction(){
		return actionBuilder.getActionProduct();
	}
	
	/**
	 * Constructs a BattleAction from the current ActionBuilder object
	 * and the Character Battlestatus 
	 * @param attributes - The BattleStatus object belonging to the Character performing the Action
	 */
	public void constructBattleAction(BattleStatus attributes){
		actionBuilder.createNewAction(attributes);
	}
}
